package com.devilvan.betrice.houseprice.configuration;

import com.devilvan.betrice.cache.CacheComponent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;


/**
 * @author Evad.Wu
 * @Description 初始化header的组件
 * @date 2022-07-06
 */
@Lazy
@Configuration
public class HousePriceHeaderConfig {
    @Resource(name = "cacheComponent")
    private CacheComponent cacheComponent;

    /**
     * 深圳市 Header
     */
    @Bean(name = "shenzhenHeader")
    public Map<String, String> shenzhenHeader() {
        Map<String, String> header = new HashMap<>(16);
        header.put("accept", "application/json, text/javascript, */*; q=0.01");
        header.put("accept-encoding", "gzip, deflate, br");
        header.put("host", "sz.fang.ke.com");
        header.put("connection", "keep-alive");
        header.put("referered", "https://nn.fang.ke.com/loupan/");
        header.put("content-type", "application/json");
        header.put("user-agent", cacheComponent.getRandomUserAgent());
        header.put("cookie",
                "lianjia_uuid=b8ce6cc6-a56c-45c8-804f-96a2c9e3586e; crosSdkDT2019DeviceId=-3u2cvg-v4pzrw-t4ajbkhq42b2nyg-jffio1sue; _ga=GA1.2.779908875.1657004164; ke_uuid=593ab3f8a9a7b7e51bee801229758d1e; _jzqx=1.1657076867.1658508739.7.jzqsr=sz%2Efang%2Eke%2Ecom|jzqct=/loupan/2/ap1/.jzqsr=nn%2Efang%2Eke%2Ecom|jzqct=/loupan/; digv_extends=%7B%22utmTrackId%22%3A%22%22%7D; lianjia_ssid=5bd7f39c-3eb0-4b01-9b6a-939b51162b42; _gid=GA1.2.1833639948.1658599762; _gat_global=1; _gat_new_global=1; _gat_dianpu_agent=1; __xsptplusUT_788=1; _jzqa=1.1356633016152656600.1657004165.1658508739.1658599762.30; _jzqc=1; _jzqckmp=1; f-token=KkB1VIyhmTngerPIwczl2nt5VepYo0rYuT7smusL+N/HJ/sCoUrbCcgpJ6Bqb7pePtSu6yWNvwWlP5R5B1R5rvwktSYm6e58dswrdBg3DK2qI0ikhLOxyiEzljiM20KMbs92jmP7Wks3LKWYe9sqwk8p; cy_ip=120.197.102.70; select_city=440300; digData=%7B%22key%22%3A%22loupan_index%22%7D; __xsptplus788=788.28.1658599762.1658599782.2%234%7C%7C%7C%7C%7C%23%23kqpViNfDBgLAx1_X7JU1E0FvIgfXDJfR%23; _qzja=1.607531900.1657072854210.1658508739221.1658599782186.1658508739221.1658599782186.0.0.0.51.28; _qzjc=1; _qzjto=1.1.0; _jzqb=1.2.10.1658599762.1; _qzjb=1.1658599782186.1.0.0.0; srcid=eyJ0IjoiXCJ7XFxcImRhdGFcXFwiOlxcXCJlMjllNTYxM2RlMjcwYWIyZDc2OWVlZDY4OTUyNTQ1ODI0NDY3MGU0MmIzZjc0Y2E4YjkzMWE5MTMzMjYxZjIxYWQ4Zjc3ZmM4YzA0NmU4YTcxYmIyZWE1YjEwYzQ2MmRjNzM3ZWE4ODYzY2MwMWZhZTUzMmQ4OGY3ZDQ2ZmQxNmY4OTU4MDA0NTcyYzc2OTY3NjY2NzVkNGMwMjdlMDYzMDQ0ZDZlNTcxYzFkZDhiNWEzYTQ4YjM5MTZiZTZhYzAzZTc4MDAwYTE5MzE2ZWY3ZDkyNGQzMTYyNTcxNjM0ODA2OTc2NDQxZDYwYjNjMjM3ZjJkNmFhYmFlMGM0MzliXFxcIixcXFwia2V5X2lkXFxcIjpcXFwiMVxcXCIsXFxcInNpZ25cXFwiOlxcXCJmMTFjNTU1ZFxcXCJ9XCIiLCJyIjoiaHR0cHM6Ly9zei5mYW5nLmtlLmNvbS9sb3VwYW4vIiwib3MiOiJ3ZWIiLCJ2IjoiMC4xIn0=; search_position=search_result; lj_newh_session=eyJpdiI6IndkS3JtbHpFZnJaSFwvWTQyWUVMRnJRPT0iLCJ2YWx1ZSI6ImZUNDVuUnFCWGpJNXFmUHFUWHJpXC9tWUdxMXYrczJmY3kybU85c3ZFZDFlVFc2U2dqTHY5RjFxajNcL3lyYkNnc1R3U2NFSlBXWEhvYWpcL2JpODQ1QnFRPT0iLCJtYWMiOiJmZGUxOTM0MGNmMTEzNGJmMmZlNWI0ZWNkMDEyY2ExOGI4YzhjNjNhYjk0YWQ4MjlkMTU5ZDBjYzY2YjFhMDRmIn0%3D"
        );
        return header;
    }
}
